package com.common.service.impl;

import com.common.dao.OperationLogDAO;
import com.common.dto.OperationLogDTO;
import com.common.service.OperationLogService;
import com.common.util.ConstantDefine;
import com.common.vo.OperationLogVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class OperationLogServiceImpl implements OperationLogService {

    @Autowired
    private OperationLogDAO operationLogDAO;

    @Override
    public int insert(OperationLogVO operationLogVO) {
        return operationLogDAO.insertOperationLog(operationLogVO);
    }

    @Override
    public Map<String, Object> selectByPaging(OperationLogDTO entity) {
        Map<String, Object> map = new HashMap<>();
        List<Map<String, Object>> list = operationLogDAO.selectByPaging(entity);
        map.put(ConstantDefine.ROWS, list);
        return map;
    }
}
